<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gimpfile: GIMP 3 Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GIMP 3 Library Reference Manual">
<link rel="up" href="libgimp-image.html" title="Manipulating Images and their Properties">
<link rel="prev" href="libgimp3-gimpedit.html" title="gimpedit">
<link rel="next" href="libgimp3-gimpfloatingsel.html" title="gimpfloatingsel">
<meta name="generator" content="GTK-Doc V1.33.0 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libgimp3-gimpfile.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libgimp-image.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libgimp3-gimpedit.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libgimp3-gimpfloatingsel.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgimp3-gimpfile"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgimp3-gimpfile.top_of_page"></a>gimpfile</span></h2>
<p>gimpfile — Image file operations (load, save, etc.)</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libgimp3-gimpfile.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GimpImage.html" title="gimpimage"><span class="returnvalue">GimpImage</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgimp3-gimpfile.html#gimp-file-load" title="gimp_file_load ()">gimp_file_load</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GimpLayer.html" title="gimplayer"><span class="returnvalue">GimpLayer</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgimp3-gimpfile.html#gimp-file-load-layer" title="gimp_file_load_layer ()">gimp_file_load_layer</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GimpLayer.html" title="gimplayer"><span class="returnvalue">GimpLayer</span></a> **
</td>
<td class="function_name">
<a class="link" href="libgimp3-gimpfile.html#gimp-file-load-layers" title="gimp_file_load_layers ()">gimp_file_load_layers</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libgimp3-gimpfile.html#gimp-file-save" title="gimp_file_save ()">gimp_file_save</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libgimp3-gimpfile.html#gimp-file-save-thumbnail" title="gimp_file_save_thumbnail ()">gimp_file_save_thumbnail</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgimp3-gimpfile.description"></a><h2>Description</h2>
<p>Image file operations (load, save, etc.)</p>
</div>
<div class="refsect1">
<a name="libgimp3-gimpfile.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gimp-file-load"></a><h3>gimp_file_load ()</h3>
<pre class="programlisting"><a class="link" href="GimpImage.html" title="gimpimage"><span class="returnvalue">GimpImage</span></a> *
gimp_file_load (<em class="parameter"><code><a href="../html/libgimpbase3-gimpbaseenums.html#GimpRunMode"><span class="type">GimpRunMode</span></a> run_mode</code></em>,
                <em class="parameter"><code><span class="type">GFile</span> *file</code></em>);</pre>
<p>Loads an image file by invoking the right load handler.</p>
<p>This procedure invokes the correct file load handler using magic if
possible, and falling back on the file's extension and/or prefix if
not.</p>
<div class="refsect3">
<a name="gimp-file-load.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>run_mode</p></td>
<td class="parameter_description"><p>The run mode.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description"><p>The file to load.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-file-load.returns"></a><h4>Returns</h4>
<p>The output image. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-file-load-layer"></a><h3>gimp_file_load_layer ()</h3>
<pre class="programlisting"><a class="link" href="GimpLayer.html" title="gimplayer"><span class="returnvalue">GimpLayer</span></a> *
gimp_file_load_layer (<em class="parameter"><code><a href="../html/libgimpbase3-gimpbaseenums.html#GimpRunMode"><span class="type">GimpRunMode</span></a> run_mode</code></em>,
                      <em class="parameter"><code><a class="link" href="GimpImage.html" title="gimpimage"><span class="type">GimpImage</span></a> *image</code></em>,
                      <em class="parameter"><code><span class="type">GFile</span> *file</code></em>);</pre>
<p>Loads an image file as a layer for an existing image.</p>
<p>This procedure behaves like the file-load procedure but opens the
specified image as a layer for an existing image. The returned layer
needs to be added to the existing image with
<a class="link" href="GimpImage.html#gimp-image-insert-layer" title="gimp_image_insert_layer ()"><code class="function">gimp_image_insert_layer()</code></a>.</p>
<div class="refsect3">
<a name="gimp-file-load-layer.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>run_mode</p></td>
<td class="parameter_description"><p>The run mode.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>image</p></td>
<td class="parameter_description"><p>Destination image.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description"><p>The file to load.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-file-load-layer.returns"></a><h4>Returns</h4>
<p>The layer created when loading the image file. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-file-load-layers"></a><h3>gimp_file_load_layers ()</h3>
<pre class="programlisting"><a class="link" href="GimpLayer.html" title="gimplayer"><span class="returnvalue">GimpLayer</span></a> **
gimp_file_load_layers (<em class="parameter"><code><a href="../html/libgimpbase3-gimpbaseenums.html#GimpRunMode"><span class="type">GimpRunMode</span></a> run_mode</code></em>,
                       <em class="parameter"><code><a class="link" href="GimpImage.html" title="gimpimage"><span class="type">GimpImage</span></a> *image</code></em>,
                       <em class="parameter"><code><span class="type">GFile</span> *file</code></em>,
                       <em class="parameter"><code><span class="type">gint</span> *num_layers</code></em>);</pre>
<p>Loads an image file as layers for an existing image.</p>
<p>This procedure behaves like the file-load procedure but opens the
specified image as layers for an existing image. The returned layers
needs to be added to the existing image with
<a class="link" href="GimpImage.html#gimp-image-insert-layer" title="gimp_image_insert_layer ()"><code class="function">gimp_image_insert_layer()</code></a>.</p>
<div class="refsect3">
<a name="gimp-file-load-layers.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>run_mode</p></td>
<td class="parameter_description"><p>The run mode.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>image</p></td>
<td class="parameter_description"><p>Destination image.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description"><p>The file to load.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>num_layers</p></td>
<td class="parameter_description"><p>The number of loaded layers. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-file-load-layers.returns"></a><h4>Returns</h4>
<p>The list of loaded layers.
The returned value must be freed with <code class="function">g_free()</code>. </p>
<p><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=num_layers][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GimpLayer][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-file-save"></a><h3>gimp_file_save ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gimp_file_save (<em class="parameter"><code><a href="../html/libgimpbase3-gimpbaseenums.html#GimpRunMode"><span class="type">GimpRunMode</span></a> run_mode</code></em>,
                <em class="parameter"><code><a class="link" href="GimpImage.html" title="gimpimage"><span class="type">GimpImage</span></a> *image</code></em>,
                <em class="parameter"><code><span class="type">gint</span> num_drawables</code></em>,
                <em class="parameter"><code>const <a class="link" href="GimpItem.html" title="gimpitem"><span class="type">GimpItem</span></a> **drawables</code></em>,
                <em class="parameter"><code><span class="type">GFile</span> *file</code></em>);</pre>
<p>Saves a file by extension.</p>
<p>This procedure invokes the correct file save handler according to
the file's extension and/or prefix.</p>
<div class="refsect3">
<a name="gimp-file-save.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>run_mode</p></td>
<td class="parameter_description"><p>The run mode.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>image</p></td>
<td class="parameter_description"><p>Input image.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>num_drawables</p></td>
<td class="parameter_description"><p>The number of drawables to save.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>drawables</p></td>
<td class="parameter_description"><p>Drawables to save. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=num_drawables][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GimpItem]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description"><p>The file to save the image in.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-file-save.returns"></a><h4>Returns</h4>
<p> TRUE on success.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-file-save-thumbnail"></a><h3>gimp_file_save_thumbnail ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gimp_file_save_thumbnail (<em class="parameter"><code><a class="link" href="GimpImage.html" title="gimpimage"><span class="type">GimpImage</span></a> *image</code></em>,
                          <em class="parameter"><code><span class="type">GFile</span> *file</code></em>);</pre>
<p>Saves a thumbnail for the given image</p>
<p>This procedure saves a thumbnail for the given image according to
the Free Desktop Thumbnail Managing Standard. The thumbnail is saved
so that it belongs to the given file. This means you have to save
the image under this name first, otherwise this procedure will fail.
This procedure may become useful if you want to explicitly save a
thumbnail with a file.</p>
<div class="refsect3">
<a name="gimp-file-save-thumbnail.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>image</p></td>
<td class="parameter_description"><p>The image.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description"><p>The file the thumbnail belongs to.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-file-save-thumbnail.returns"></a><h4>Returns</h4>
<p> TRUE on success.</p>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.0</div>
</body>
</html>